package ru.ipccenter.webBeans;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author Mari
 */
@ManagedBean(name = "MusicSearch")
@SessionScoped
public class MusicSearchBean implements Serializable {

    private String title;
    private String author;
    private String album;
    private String genre;
    private String year;
    private List<String> genres = new ArrayList<String>();

    public void setTitle(String title) {
        this.title = title;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public void setAlbum(String album) {
        this.album = album;
    }

    public void setGenre(String genre) {
        this.genre = genre;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public List<String> getGenres() {
        return genres;
    }

    public String getTitle() {
        return title;
    }

    public String getAuthor() {
        return author;
    }

    public String getAlbum() {
        return album;
    }

    public String getGenre() {
        return genre;
    }

    public String getYear() {
        return year;
    }


    public void setGenres(List<String> genres) {
        this.genres = genres;
    }


    public void doAction() {  //actionListener
        //do search
        System.out.println(title);
        System.out.println(year);
    }

    public MusicSearchBean() {
        //in constructor you shuld put misc genres in ArrayList
        genres.add("Any");
        genres.add("Rock");
        genres.add("R&B");
        
        //...
    }
}
